โ– humdrum codex / sportsball v0.1.0
license AGPL-3.0
2.7 KB raw
id
TASK-005
title
Theme system (Flexoki/Humdrum/Uchu, light+dark)
status
๐Ÿ Done
assignee
created_date
2026-06-16 18:03
updated_date
2026-06-18 01:17
labels
feature
dependencies
priority
medium
ordinal
5000

Description

Replace hardcoded Flexoki-dark palette in theme.go with a Theme struct + registry. Port the six palettes from a shared design-token set ([data-theme] sets: flexoki, flexoki-dark, uchu, uchu-dark, humdrum, humdrum-dark). Runtime switch + persist. Currently Flexoki-dark is hardcoded.

Acceptance Criteria

Implementation Notes

Rewrote theme.go: Theme struct + 6-entry registry (flexoki(-dark), uchu(-dark), humdrum(-dark)) ported from the shared token set. uchu/humdrum oklch ramps converted to sRGB hex. Structural tokens concrete per-variant (dropped AdaptiveColor); 6 accents mapped by hue so sport semantics stay constant. applyTheme repoints col* globals + rebuilds style* via buildStyles(); init() applies default so test literals work. 't' key cycles + persists to config.Theme; New() loads persisted theme; active theme name shown in dashboard footer. liveDot pulses active live color. Added theme_test.go.

Follow-up: View() now paints the theme bg across the whole frame (paintBackground) so light-on-dark-terminal mismatch is gone. Theme cycling ('t') restricted to palettes matching terminal appearance (themesFor/resolveTheme via lipgloss.HasDarkBackground); persisted theme honored only if it matches appearance. Tests added; binary reinstalled.

Final Summary

Replaces the hardcoded Flexoki-dark palette with a swappable Theme registry of all six app-kit palettes (flexoki, flexoki-dark, uchu, uchu-dark, humdrum, humdrum-dark), ported from a shared design-token set with the uchu/humdrum oklch ramps converted to sRGB hex. Each theme is an explicit light/dark variant with concrete structural tokens (no AdaptiveColor); the six accents are hue-mapped from each source ramp so red=live, green=win etc. hold across themes. applyTheme() swaps the col* globals and rebuilds all derived styles; an init() applies the default. Press 't' to cycle (persisted via config.Theme, restored on launch); the active theme name renders bottom-right of the dashboard footer. Tests cover palette validity, applyTheme repointing globals+styles, and themeIndex fallback. go vet/build + full suite green.